<pre><?//print_r($arResult);?></pre>
<?
foreach($arResult["ITEMS"] as $k => $item):
    if(count($item["OFFERS"])):
       $arResult["ITEMS"][$k]["OFFERS_BOOL"]=true;      
       $maxval=0;
       $minval=20000000; 
       foreach($item["OFFERS"] as $offersitem):
           if($maxval<$offersitem["CATALOG_PRICE_1"]){$maxval=$offersitem["CATALOG_PRICE_1"];$maxoffers=$offersitem;}
           if($minval>$offersitem["CATALOG_PRICE_1"]){$minval=$offersitem["CATALOG_PRICE_1"];$minoffers=$offersitem;}              
       endforeach;
       $arResult["ITEMS"][$k]["MAXVALUE"]=$maxval;
       $arResult["ITEMS"][$k]["MINVALUE"]=$minval; 
       $arResult["ITEMS"][$k]["MAXOFFERS"]=$maxoffers;
       $arResult["ITEMS"][$k]["MINOFFERS"]=$minoffers; 
    endif; 

$small_image = $APPLICATION->IncludeComponent("soulstream:imager", "", Array(
    									"MODE" => "4",
										"RETURN" => "src",
										"IMAGE" => $item["PREVIEW_PICTURE"]["SRC"],
										"WIDTH" => "119",
										"HEIGHT" => "153",
										"ADD_WATERMARK" => "N",
										
										),false, array("HIDE_ICONS"=>"Y")
					);

$arResult["ITEMS"][$k]["SMALL_IMAGE"]=$small_image;				    
endforeach;    


$lcur = CCurrency::GetList(($b="name"), ($order1="asc"), LANGUAGE_ID);
$URLcon="";
while($lcur_res = $lcur->Fetch())
    { 
        $URLcurrency.='<a href="?SETCURRENCY='.$lcur_res["CURRENCY"].'"> '.$lcur_res["CURRENCY"].' </a>';  
    }; 
$arResult["CurrencyURL"]=$URLcurrency;
if(!empty($_REQUEST["SETCURRENCY"]))$_SESSION["USER_SHOW_CIURRENCY"]=$_REQUEST["SETCURRENCY"];
if(empty($_SESSION["USER_SHOW_CIURRENCY"]))$_SESSION["USER_SHOW_CIURRENCY"]=CCurrency::GetBaseCurrency();
//echo $_SESSION["USER_SHOW_CIURRENCY"]." ".$arResult["CurrencyURL"];

?>

<?/*$quantity = 0;
arrprint()
foreach($arResult["ITEMS"] as $arElement):
	foreach ($arElement["OFFERS"] as $arOffers):
		$quantity = $quantity + $arOffers["CATALOG_QUANTITY"];
		$arElement["CATALOG_QUANTITY"] = $quantity;
	endforeach;
endforeach;*/?>